import allure
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver

from src.day36.pages.base_page import BasePage
from src.day36.pages.contact_page import ContactPage


class MainPage(BasePage):
    __CONTACT_LINK=(By.ID, "1menu_contacts")   #通讯录页面元素， __表示私有属性

    def goto_contact(self):
        """
        跳转通讯录页面
        :return:
        """
        with allure.step("跳转到通讯录页面"):
            self.find_and_click(*self.__CONTACT_LINK)
        return ContactPage(self.driver)
